<template>
	<view class="my-search-container" :style="{'background-color':bgcolor}" @click="SearchBoxHanlder">
		<view class="search-box" :style="{'border-radius':radius + 'px'}">
			<uni-icons type="search" size="17"></uni-icons>
			<text class="palceholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"search",
		props:{
			// 定义搜索的圆角以及背景颜色
			bgcolor:{
				type:String,
				default:'#C00000'
			},
			radius:{
				type:Number,
				default:18
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			SearchBoxHanlder(){
				console.log('!!')
				this.$emit('search')
			}
		}
	}
</script>

<style lang="scss">
	.my-search-container{
		height: 50px;
		// background-color: #C00000;
		display: flex;
		align-items: center; 
		padding: 0 10px; 
		.search-box{
			height: 36px;
			background-color: #fff;
			// border-radius: 18px;
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;
			.palceholder{
				font-size: 15px;
				margin-left: 5px;
			}
		}
	}
</style>